﻿@model IEnumerable<ASM_Group2.Models.Category>

@{
    ViewBag.Title = "Index";
}
<h2>Admin Control</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.NameCategory)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Image)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.NameCategory)
        </td>
        <td>
            <img  src="~/Images/@Html.DisplayFor(modelItem => item.Image)" />
        </td>
        <td>
            @Html.ActionLink("ViewProduct", "Category", "Product", new { cid = @item.CategoryId }, null) |
            @Html.ActionLink("Edit", "Edit", new { id=item.CategoryId }) |
            @Html.ActionLink("Details", "Details", new { id=item.CategoryId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.CategoryId })
        </td>
    </tr>
}

</table>
